package org.freez4.spring.ioc.overview.domain;

import java.util.Properties;

/**
 * 用户类。
 *
 * @author 阿坤同学
 * @date 2023/11/30 22:48
 */
public class User {

    private Integer id;

    private Integer age;

    private String name;

    private Company company;

    private Properties context;

    private String contextAsText;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public Properties getContext() {
        return context;
    }

    public void setContext(Properties context) {
        this.context = context;
    }

    public String getContextAsText() {
        return contextAsText;
    }

    public void setContextAsText(String contextAsText) {
        this.contextAsText = contextAsText;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", age=" + age +
                ", name='" + name + '\'' +
                ", company=" + company +
                ", context=" + context +
                ", contextAsText='" + contextAsText + '\'' +
                '}';
    }

    /**
     * 静态方法创建一个User对象。
     *
     * @return User对象
     * @author 阿坤同学
     * @date 2023/12/6 4:17 PM
     */
    public static User createUser() {
        User user = new User();
        user.setId(3);
        user.setName("静态方法创建的Bean");
        user.setAge(100);
        return user;
    }

}
